package com.yunfangdata.query;

import com.alibaba.druid.util.StringUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yunfangdata.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * Created by 徐飞 on 2018/7/12.
 */

@Getter
@Setter
public class StudentstatusObject extends QueryObject  {

    private String keyword;

    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date beginDate;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date endDate;
    public String getKeyword(){
        if (StringUtils.isEmpty(keyword)){
            return null ;
        }
        return keyword;
    }
   /* public String getSort(){
        return StringUtils.isEmpty(sort)?"null":sort;
    }
    public String getOrder(){
        return StringUtils.isEmpty(order)?"":order;
    }*/

    public Date getEndDate(){
        if (endDate!=null) {
            return DateUtil.getEndDate(endDate);
        }
        return null ;
    }

}
